import pandas as pd
import numpy as np

file_path = 'IMDB-Movie-Data.csv'
df = pd.read_csv(file_path)

# print(df.info())

print(df.head(1))

# 获取平均评分
print(df['Rating'].mean())

# 导演的人数
print(len(set(df['Director'])))
print(len(df['Director'].unique()))

# 演员的人数
temp_actors = df['Actors'].str.split(', ').tolist()
'''
# 相当于上面这句话tolist
temp_actors = df['Actors'].str.split(', ')
print(type(temp_actors))
temp_actors = list(temp_actors)
print(temp_actors[:2])
'''
print(temp_actors[:2])
actors_list = [j for i in temp_actors for j in i]
print(actors_list[:2])
actors_num = len(set(actors_list))
print(actors_num)